import Cookies from 'js-cookie';
import Setting from './setting';


// 设置cookie
export const setToken = (token, tokenExpires) => {
    return Cookies.set(Setting.tokenKey, token, { expires: tokenExpires || 1 });
};
// 获取cookie
export const getToken = () => {
    return Cookies.get(Setting.tokenKey);
};
// 删除cookie
export const removeToken = () => {
    return Cookies.remove(Setting.tokenKey);
};
// 设置创建cookie时间
export const setTokenTime = () => {
    return Cookies.set(Setting.timeKey,Date.now());
};

// 获取cookie时间
export const getTokenTime = () => {
    return Cookies.get(Setting.timeKey);
};